package com.example.film.service;

import com.example.film.entity.FilmComment;
import com.example.film.mapper.FilmCommentMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class FilmCommentServiceImpl implements FilmCommentService{
    @Autowired
    private FilmCommentMapper filmCommentMapper;

    @Override
    public List<FilmComment> findFilmCommentByRank(Integer filmRank) {
        return filmCommentMapper.findFilmCommentByRank(filmRank);
    }

    @Override
    public List<FilmComment> findFilmCommentInfo(Integer filmRank, Integer pageNum, Integer pageSize) {
        int startIndex = (pageNum - 1) * pageSize;
        return filmCommentMapper.findFilmCommentInfo(filmRank,startIndex,pageSize);
    }

}
